<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Navo Portable Library: navo/algorithm/crypto/symmetric/cast5.c源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- 制作者 Doxygen 1.7.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Navo Portable Library&#160;<span id="projectnumber">Ver 1.0.20120827</span></div>
   <div id="projectbrief">Provides generic platform independent facilities.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="modules.html"><span>模块</span></a></li>
      <li><a href="annotated.html"><span>数据结构</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>文件列表</span></a></li>
      <li><a href="globals.html"><span>全局定义</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<h1>navo/algorithm/crypto/symmetric/cast5.c</h1>  </div>
</div>
<div class="contents">
<a href="cast5_8c.html">浏览该文件的文档。</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */</span>
<a name="l00011"></a>00011 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span><span class="preprocessor">#pragma optimize(&quot;t&quot;, on)</span>
<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#endif  </span><span class="comment">/* #ifdef _MSC_VER */</span>
<a name="l00014"></a>00014 
<a name="l00015"></a>00015 <span class="preprocessor">#include &quot;<a class="code" href="cast5_8h.html" title="Cast5.">cast5.h</a>&quot;</span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &quot;<a class="code" href="endian_8h.html" title="Definitions for byte order.">../../../port/endian.h</a>&quot;</span>
<a name="l00017"></a>00017 
<a name="l00018"></a>00018 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#include &lt;cstring&gt;</span>
<a name="l00020"></a>00020 <span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00021"></a>00021 <span class="preprocessor">#else</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#endif </span><span class="comment">/* #ifdef __cplusplus */</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="keyword">static</span> <span class="keyword">const</span> uint32_t S5[256] = {
<a name="l00026"></a>00026     0x7ec90c04UL, 0x2c6e74b9UL, 0x9b0e66dfUL, 0xa6337911UL, 
<a name="l00027"></a>00027     0xb86a7fffUL, 0x1dd358f5UL, 0x44dd9d44UL, 0x1731167fUL,
<a name="l00028"></a>00028     0x08fbf1faUL, 0xe7f511ccUL, 0xd2051b00UL, 0x735aba00UL, 
<a name="l00029"></a>00029     0x2ab722d8UL, 0x386381cbUL, 0xacf6243aUL, 0x69befd7aUL,
<a name="l00030"></a>00030     0xe6a2e77fUL, 0xf0c720cdUL, 0xc4494816UL, 0xccf5c180UL, 
<a name="l00031"></a>00031     0x38851640UL, 0x15b0a848UL, 0xe68b18cbUL, 0x4caadeffUL,
<a name="l00032"></a>00032     0x5f480a01UL, 0x0412b2aaUL, 0x259814fcUL, 0x41d0efe2UL, 
<a name="l00033"></a>00033     0x4e40b48dUL, 0x248eb6fbUL, 0x8dba1cfeUL, 0x41a99b02UL,
<a name="l00034"></a>00034     0x1a550a04UL, 0xba8f65cbUL, 0x7251f4e7UL, 0x95a51725UL, 
<a name="l00035"></a>00035     0xc106ecd7UL, 0x97a5980aUL, 0xc539b9aaUL, 0x4d79fe6aUL,
<a name="l00036"></a>00036     0xf2f3f763UL, 0x68af8040UL, 0xed0c9e56UL, 0x11b4958bUL, 
<a name="l00037"></a>00037     0xe1eb5a88UL, 0x8709e6b0UL, 0xd7e07156UL, 0x4e29fea7UL,
<a name="l00038"></a>00038     0x6366e52dUL, 0x02d1c000UL, 0xc4ac8e05UL, 0x9377f571UL, 
<a name="l00039"></a>00039     0x0c05372aUL, 0x578535f2UL, 0x2261be02UL, 0xd642a0c9UL,
<a name="l00040"></a>00040     0xdf13a280UL, 0x74b55bd2UL, 0x682199c0UL, 0xd421e5ecUL, 
<a name="l00041"></a>00041     0x53fb3ce8UL, 0xc8adedb3UL, 0x28a87fc9UL, 0x3d959981UL,
<a name="l00042"></a>00042     0x5c1ff900UL, 0xfe38d399UL, 0x0c4eff0bUL, 0x062407eaUL, 
<a name="l00043"></a>00043     0xaa2f4fb1UL, 0x4fb96976UL, 0x90c79505UL, 0xb0a8a774UL,
<a name="l00044"></a>00044     0xef55a1ffUL, 0xe59ca2c2UL, 0xa6b62d27UL, 0xe66a4263UL, 
<a name="l00045"></a>00045     0xdf65001fUL, 0x0ec50966UL, 0xdfdd55bcUL, 0x29de0655UL,
<a name="l00046"></a>00046     0x911e739aUL, 0x17af8975UL, 0x32c7911cUL, 0x89f89468UL, 
<a name="l00047"></a>00047     0x0d01e980UL, 0x524755f4UL, 0x03b63cc9UL, 0x0cc844b2UL,
<a name="l00048"></a>00048     0xbcf3f0aaUL, 0x87ac36e9UL, 0xe53a7426UL, 0x01b3d82bUL, 
<a name="l00049"></a>00049     0x1a9e7449UL, 0x64ee2d7eUL, 0xcddbb1daUL, 0x01c94910UL,
<a name="l00050"></a>00050     0xb868bf80UL, 0x0d26f3fdUL, 0x9342ede7UL, 0x04a5c284UL, 
<a name="l00051"></a>00051     0x636737b6UL, 0x50f5b616UL, 0xf24766e3UL, 0x8eca36c1UL,
<a name="l00052"></a>00052     0x136e05dbUL, 0xfef18391UL, 0xfb887a37UL, 0xd6e7f7d4UL, 
<a name="l00053"></a>00053     0xc7fb7dc9UL, 0x3063fcdfUL, 0xb6f589deUL, 0xec2941daUL,
<a name="l00054"></a>00054     0x26e46695UL, 0xb7566419UL, 0xf654efc5UL, 0xd08d58b7UL, 
<a name="l00055"></a>00055     0x48925401UL, 0xc1bacb7fUL, 0xe5ff550fUL, 0xb6083049UL,
<a name="l00056"></a>00056     0x5bb5d0e8UL, 0x87d72e5aUL, 0xab6a6ee1UL, 0x223a66ceUL, 
<a name="l00057"></a>00057     0xc62bf3cdUL, 0x9e0885f9UL, 0x68cb3e47UL, 0x086c010fUL,
<a name="l00058"></a>00058     0xa21de820UL, 0xd18b69deUL, 0xf3f65777UL, 0xfa02c3f6UL, 
<a name="l00059"></a>00059     0x407edac3UL, 0xcbb3d550UL, 0x1793084dUL, 0xb0d70ebaUL,
<a name="l00060"></a>00060     0x0ab378d5UL, 0xd951fb0cUL, 0xded7da56UL, 0x4124bbe4UL, 
<a name="l00061"></a>00061     0x94ca0b56UL, 0x0f5755d1UL, 0xe0e1e56eUL, 0x6184b5beUL,
<a name="l00062"></a>00062     0x580a249fUL, 0x94f74bc0UL, 0xe327888eUL, 0x9f7b5561UL, 
<a name="l00063"></a>00063     0xc3dc0280UL, 0x05687715UL, 0x646c6bd7UL, 0x44904db3UL,
<a name="l00064"></a>00064     0x66b4f0a3UL, 0xc0f1648aUL, 0x697ed5afUL, 0x49e92ff6UL, 
<a name="l00065"></a>00065     0x309e374fUL, 0x2cb6356aUL, 0x85808573UL, 0x4991f840UL,
<a name="l00066"></a>00066     0x76f0ae02UL, 0x083be84dUL, 0x28421c9aUL, 0x44489406UL, 
<a name="l00067"></a>00067     0x736e4cb8UL, 0xc1092910UL, 0x8bc95fc6UL, 0x7d869cf4UL,
<a name="l00068"></a>00068     0x134f616fUL, 0x2e77118dUL, 0xb31b2be1UL, 0xaa90b472UL, 
<a name="l00069"></a>00069     0x3ca5d717UL, 0x7d161bbaUL, 0x9cad9010UL, 0xaf462ba2UL,
<a name="l00070"></a>00070     0x9fe459d2UL, 0x45d34559UL, 0xd9f2da13UL, 0xdbc65487UL, 
<a name="l00071"></a>00071     0xf3e4f94eUL, 0x176d486fUL, 0x097c13eaUL, 0x631da5c7UL,
<a name="l00072"></a>00072     0x445f7382UL, 0x175683f4UL, 0xcdc66a97UL, 0x70be0288UL, 
<a name="l00073"></a>00073     0xb3cdcf72UL, 0x6e5dd2f3UL, 0x20936079UL, 0x459b80a5UL,
<a name="l00074"></a>00074     0xbe60e2dbUL, 0xa9c23101UL, 0xeba5315cUL, 0x224e42f2UL, 
<a name="l00075"></a>00075     0x1c5c1572UL, 0xf6721b2cUL, 0x1ad2fff3UL, 0x8c25404eUL,
<a name="l00076"></a>00076     0x324ed72fUL, 0x4067b7fdUL, 0x0523138eUL, 0x5ca3bc78UL, 
<a name="l00077"></a>00077     0xdc0fd66eUL, 0x75922283UL, 0x784d6b17UL, 0x58ebb16eUL,
<a name="l00078"></a>00078     0x44094f85UL, 0x3f481d87UL, 0xfcfeae7bUL, 0x77b5ff76UL, 
<a name="l00079"></a>00079     0x8c2302bfUL, 0xaaf47556UL, 0x5f46b02aUL, 0x2b092801UL,
<a name="l00080"></a>00080     0x3d38f5f7UL, 0x0ca81f36UL, 0x52af4a8aUL, 0x66d5e7c0UL, 
<a name="l00081"></a>00081     0xdf3b0874UL, 0x95055110UL, 0x1b5ad7a8UL, 0xf61ed5adUL,
<a name="l00082"></a>00082     0x6cf6e479UL, 0x20758184UL, 0xd0cefa65UL, 0x88f7be58UL, 
<a name="l00083"></a>00083     0x4a046826UL, 0x0ff6f8f3UL, 0xa09c7f70UL, 0x5346aba0UL,
<a name="l00084"></a>00084     0x5ce96c28UL, 0xe176eda3UL, 0x6bac307fUL, 0x376829d2UL, 
<a name="l00085"></a>00085     0x85360fa9UL, 0x17e3fe2aUL, 0x24b79767UL, 0xf5a96b20UL,
<a name="l00086"></a>00086     0xd6cd2595UL, 0x68ff1ebfUL, 0x7555442cUL, 0xf19f06beUL, 
<a name="l00087"></a>00087     0xf9e0659aUL, 0xeeb9491dUL, 0x34010718UL, 0xbb30cab8UL,
<a name="l00088"></a>00088     0xe822fe15UL, 0x88570983UL, 0x750e6249UL, 0xda627e55UL, 
<a name="l00089"></a>00089     0x5e76ffa8UL, 0xb1534546UL, 0x6d47de08UL, 0xefe9e7d4UL
<a name="l00090"></a>00090 };
<a name="l00091"></a>00091 
<a name="l00092"></a>00092 <span class="keyword">static</span> <span class="keyword">const</span> uint32_t S6[256] = {
<a name="l00093"></a>00093     0xf6fa8f9dUL, 0x2cac6ce1UL, 0x4ca34867UL, 0xe2337f7cUL, 
<a name="l00094"></a>00094     0x95db08e7UL, 0x016843b4UL, 0xeced5cbcUL, 0x325553acUL,
<a name="l00095"></a>00095     0xbf9f0960UL, 0xdfa1e2edUL, 0x83f0579dUL, 0x63ed86b9UL, 
<a name="l00096"></a>00096     0x1ab6a6b8UL, 0xde5ebe39UL, 0xf38ff732UL, 0x8989b138UL,
<a name="l00097"></a>00097     0x33f14961UL, 0xc01937bdUL, 0xf506c6daUL, 0xe4625e7eUL, 
<a name="l00098"></a>00098     0xa308ea99UL, 0x4e23e33cUL, 0x79cbd7ccUL, 0x48a14367UL,
<a name="l00099"></a>00099     0xa3149619UL, 0xfec94bd5UL, 0xa114174aUL, 0xeaa01866UL, 
<a name="l00100"></a>00100     0xa084db2dUL, 0x09a8486fUL, 0xa888614aUL, 0x2900af98UL,
<a name="l00101"></a>00101     0x01665991UL, 0xe1992863UL, 0xc8f30c60UL, 0x2e78ef3cUL, 
<a name="l00102"></a>00102     0xd0d51932UL, 0xcf0fec14UL, 0xf7ca07d2UL, 0xd0a82072UL,
<a name="l00103"></a>00103     0xfd41197eUL, 0x9305a6b0UL, 0xe86be3daUL, 0x74bed3cdUL, 
<a name="l00104"></a>00104     0x372da53cUL, 0x4c7f4448UL, 0xdab5d440UL, 0x6dba0ec3UL,
<a name="l00105"></a>00105     0x083919a7UL, 0x9fbaeed9UL, 0x49dbcfb0UL, 0x4e670c53UL, 
<a name="l00106"></a>00106     0x5c3d9c01UL, 0x64bdb941UL, 0x2c0e636aUL, 0xba7dd9cdUL,
<a name="l00107"></a>00107     0xea6f7388UL, 0xe70bc762UL, 0x35f29adbUL, 0x5c4cdd8dUL, 
<a name="l00108"></a>00108     0xf0d48d8cUL, 0xb88153e2UL, 0x08a19866UL, 0x1ae2eac8UL,
<a name="l00109"></a>00109     0x284caf89UL, 0xaa928223UL, 0x9334be53UL, 0x3b3a21bfUL, 
<a name="l00110"></a>00110     0x16434be3UL, 0x9aea3906UL, 0xefe8c36eUL, 0xf890cdd9UL,
<a name="l00111"></a>00111     0x80226daeUL, 0xc340a4a3UL, 0xdf7e9c09UL, 0xa694a807UL, 
<a name="l00112"></a>00112     0x5b7c5eccUL, 0x221db3a6UL, 0x9a69a02fUL, 0x68818a54UL,
<a name="l00113"></a>00113     0xceb2296fUL, 0x53c0843aUL, 0xfe893655UL, 0x25bfe68aUL, 
<a name="l00114"></a>00114     0xb4628abcUL, 0xcf222ebfUL, 0x25ac6f48UL, 0xa9a99387UL,
<a name="l00115"></a>00115     0x53bddb65UL, 0xe76ffbe7UL, 0xe967fd78UL, 0x0ba93563UL, 
<a name="l00116"></a>00116     0x8e342bc1UL, 0xe8a11be9UL, 0x4980740dUL, 0xc8087dfcUL,
<a name="l00117"></a>00117     0x8de4bf99UL, 0xa11101a0UL, 0x7fd37975UL, 0xda5a26c0UL, 
<a name="l00118"></a>00118     0xe81f994fUL, 0x9528cd89UL, 0xfd339fedUL, 0xb87834bfUL,
<a name="l00119"></a>00119     0x5f04456dUL, 0x22258698UL, 0xc9c4c83bUL, 0x2dc156beUL, 
<a name="l00120"></a>00120     0x4f628daaUL, 0x57f55ec5UL, 0xe2220abeUL, 0xd2916ebfUL,
<a name="l00121"></a>00121     0x4ec75b95UL, 0x24f2c3c0UL, 0x42d15d99UL, 0xcd0d7fa0UL, 
<a name="l00122"></a>00122     0x7b6e27ffUL, 0xa8dc8af0UL, 0x7345c106UL, 0xf41e232fUL,
<a name="l00123"></a>00123     0x35162386UL, 0xe6ea8926UL, 0x3333b094UL, 0x157ec6f2UL, 
<a name="l00124"></a>00124     0x372b74afUL, 0x692573e4UL, 0xe9a9d848UL, 0xf3160289UL,
<a name="l00125"></a>00125     0x3a62ef1dUL, 0xa787e238UL, 0xf3a5f676UL, 0x74364853UL, 
<a name="l00126"></a>00126     0x20951063UL, 0x4576698dUL, 0xb6fad407UL, 0x592af950UL,
<a name="l00127"></a>00127     0x36f73523UL, 0x4cfb6e87UL, 0x7da4cec0UL, 0x6c152daaUL, 
<a name="l00128"></a>00128     0xcb0396a8UL, 0xc50dfe5dUL, 0xfcd707abUL, 0x0921c42fUL,
<a name="l00129"></a>00129     0x89dff0bbUL, 0x5fe2be78UL, 0x448f4f33UL, 0x754613c9UL, 
<a name="l00130"></a>00130     0x2b05d08dUL, 0x48b9d585UL, 0xdc049441UL, 0xc8098f9bUL,
<a name="l00131"></a>00131     0x7dede786UL, 0xc39a3373UL, 0x42410005UL, 0x6a091751UL, 
<a name="l00132"></a>00132     0x0ef3c8a6UL, 0x890072d6UL, 0x28207682UL, 0xa9a9f7beUL,
<a name="l00133"></a>00133     0xbf32679dUL, 0xd45b5b75UL, 0xb353fd00UL, 0xcbb0e358UL, 
<a name="l00134"></a>00134     0x830f220aUL, 0x1f8fb214UL, 0xd372cf08UL, 0xcc3c4a13UL,
<a name="l00135"></a>00135     0x8cf63166UL, 0x061c87beUL, 0x88c98f88UL, 0x6062e397UL, 
<a name="l00136"></a>00136     0x47cf8e7aUL, 0xb6c85283UL, 0x3cc2acfbUL, 0x3fc06976UL,
<a name="l00137"></a>00137     0x4e8f0252UL, 0x64d8314dUL, 0xda3870e3UL, 0x1e665459UL, 
<a name="l00138"></a>00138     0xc10908f0UL, 0x513021a5UL, 0x6c5b68b7UL, 0x822f8aa0UL,
<a name="l00139"></a>00139     0x3007cd3eUL, 0x74719eefUL, 0xdc872681UL, 0x073340d4UL, 
<a name="l00140"></a>00140     0x7e432fd9UL, 0x0c5ec241UL, 0x8809286cUL, 0xf592d891UL,
<a name="l00141"></a>00141     0x08a930f6UL, 0x957ef305UL, 0xb7fbffbdUL, 0xc266e96fUL, 
<a name="l00142"></a>00142     0x6fe4ac98UL, 0xb173ecc0UL, 0xbc60b42aUL, 0x953498daUL,
<a name="l00143"></a>00143     0xfba1ae12UL, 0x2d4bd736UL, 0x0f25faabUL, 0xa4f3fcebUL, 
<a name="l00144"></a>00144     0xe2969123UL, 0x257f0c3dUL, 0x9348af49UL, 0x361400bcUL,
<a name="l00145"></a>00145     0xe8816f4aUL, 0x3814f200UL, 0xa3f94043UL, 0x9c7a54c2UL, 
<a name="l00146"></a>00146     0xbc704f57UL, 0xda41e7f9UL, 0xc25ad33aUL, 0x54f4a084UL,
<a name="l00147"></a>00147     0xb17f5505UL, 0x59357cbeUL, 0xedbd15c8UL, 0x7f97c5abUL, 
<a name="l00148"></a>00148     0xba5ac7b5UL, 0xb6f6deafUL, 0x3a479c3aUL, 0x5302da25UL,
<a name="l00149"></a>00149     0x653d7e6aUL, 0x54268d49UL, 0x51a477eaUL, 0x5017d55bUL, 
<a name="l00150"></a>00150     0xd7d25d88UL, 0x44136c76UL, 0x0404a8c8UL, 0xb8e5a121UL,
<a name="l00151"></a>00151     0xb81a928aUL, 0x60ed5869UL, 0x97c55b96UL, 0xeaec991bUL, 
<a name="l00152"></a>00152     0x29935913UL, 0x01fdb7f1UL, 0x088e8dfaUL, 0x9ab6f6f5UL,
<a name="l00153"></a>00153     0x3b4cbf9fUL, 0x4a5de3abUL, 0xe6051d35UL, 0xa0e1d855UL, 
<a name="l00154"></a>00154     0xd36b4cf1UL, 0xf544edebUL, 0xb0e93524UL, 0xbebb8fbdUL,
<a name="l00155"></a>00155     0xa2d762cfUL, 0x49c92f54UL, 0x38b5f331UL, 0x7128a454UL, 
<a name="l00156"></a>00156     0x48392905UL, 0xa65b1db8UL, 0x851c97bdUL, 0xd675cf2fUL
<a name="l00157"></a>00157 };
<a name="l00158"></a>00158 <span class="keyword">static</span> <span class="keyword">const</span> uint32_t S7[256] = {
<a name="l00159"></a>00159     0x85e04019UL, 0x332bf567UL, 0x662dbfffUL, 0xcfc65693UL, 
<a name="l00160"></a>00160     0x2a8d7f6fUL, 0xab9bc912UL, 0xde6008a1UL, 0x2028da1fUL,
<a name="l00161"></a>00161     0x0227bce7UL, 0x4d642916UL, 0x18fac300UL, 0x50f18b82UL, 
<a name="l00162"></a>00162     0x2cb2cb11UL, 0xb232e75cUL, 0x4b3695f2UL, 0xb28707deUL,
<a name="l00163"></a>00163     0xa05fbcf6UL, 0xcd4181e9UL, 0xe150210cUL, 0xe24ef1bdUL, 
<a name="l00164"></a>00164     0xb168c381UL, 0xfde4e789UL, 0x5c79b0d8UL, 0x1e8bfd43UL,
<a name="l00165"></a>00165     0x4d495001UL, 0x38be4341UL, 0x913cee1dUL, 0x92a79c3fUL, 
<a name="l00166"></a>00166     0x089766beUL, 0xbaeeadf4UL, 0x1286becfUL, 0xb6eacb19UL,
<a name="l00167"></a>00167     0x2660c200UL, 0x7565bde4UL, 0x64241f7aUL, 0x8248dca9UL, 
<a name="l00168"></a>00168     0xc3b3ad66UL, 0x28136086UL, 0x0bd8dfa8UL, 0x356d1cf2UL,
<a name="l00169"></a>00169     0x107789beUL, 0xb3b2e9ceUL, 0x0502aa8fUL, 0x0bc0351eUL, 
<a name="l00170"></a>00170     0x166bf52aUL, 0xeb12ff82UL, 0xe3486911UL, 0xd34d7516UL,
<a name="l00171"></a>00171     0x4e7b3affUL, 0x5f43671bUL, 0x9cf6e037UL, 0x4981ac83UL, 
<a name="l00172"></a>00172     0x334266ceUL, 0x8c9341b7UL, 0xd0d854c0UL, 0xcb3a6c88UL,
<a name="l00173"></a>00173     0x47bc2829UL, 0x4725ba37UL, 0xa66ad22bUL, 0x7ad61f1eUL, 
<a name="l00174"></a>00174     0x0c5cbafaUL, 0x4437f107UL, 0xb6e79962UL, 0x42d2d816UL,
<a name="l00175"></a>00175     0x0a961288UL, 0xe1a5c06eUL, 0x13749e67UL, 0x72fc081aUL, 
<a name="l00176"></a>00176     0xb1d139f7UL, 0xf9583745UL, 0xcf19df58UL, 0xbec3f756UL,
<a name="l00177"></a>00177     0xc06eba30UL, 0x07211b24UL, 0x45c28829UL, 0xc95e317fUL, 
<a name="l00178"></a>00178     0xbc8ec511UL, 0x38bc46e9UL, 0xc6e6fa14UL, 0xbae8584aUL,
<a name="l00179"></a>00179     0xad4ebc46UL, 0x468f508bUL, 0x7829435fUL, 0xf124183bUL, 
<a name="l00180"></a>00180     0x821dba9fUL, 0xaff60ff4UL, 0xea2c4e6dUL, 0x16e39264UL,
<a name="l00181"></a>00181     0x92544a8bUL, 0x009b4fc3UL, 0xaba68cedUL, 0x9ac96f78UL, 
<a name="l00182"></a>00182     0x06a5b79aUL, 0xb2856e6eUL, 0x1aec3ca9UL, 0xbe838688UL,
<a name="l00183"></a>00183     0x0e0804e9UL, 0x55f1be56UL, 0xe7e5363bUL, 0xb3a1f25dUL, 
<a name="l00184"></a>00184     0xf7debb85UL, 0x61fe033cUL, 0x16746233UL, 0x3c034c28UL,
<a name="l00185"></a>00185     0xda6d0c74UL, 0x79aac56cUL, 0x3ce4e1adUL, 0x51f0c802UL, 
<a name="l00186"></a>00186     0x98f8f35aUL, 0x1626a49fUL, 0xeed82b29UL, 0x1d382fe3UL,
<a name="l00187"></a>00187     0x0c4fb99aUL, 0xbb325778UL, 0x3ec6d97bUL, 0x6e77a6a9UL, 
<a name="l00188"></a>00188     0xcb658b5cUL, 0xd45230c7UL, 0x2bd1408bUL, 0x60c03eb7UL,
<a name="l00189"></a>00189     0xb9068d78UL, 0xa33754f4UL, 0xf430c87dUL, 0xc8a71302UL, 
<a name="l00190"></a>00190     0xb96d8c32UL, 0xebd4e7beUL, 0xbe8b9d2dUL, 0x7979fb06UL,
<a name="l00191"></a>00191     0xe7225308UL, 0x8b75cf77UL, 0x11ef8da4UL, 0xe083c858UL, 
<a name="l00192"></a>00192     0x8d6b786fUL, 0x5a6317a6UL, 0xfa5cf7a0UL, 0x5dda0033UL,
<a name="l00193"></a>00193     0xf28ebfb0UL, 0xf5b9c310UL, 0xa0eac280UL, 0x08b9767aUL, 
<a name="l00194"></a>00194     0xa3d9d2b0UL, 0x79d34217UL, 0x021a718dUL, 0x9ac6336aUL,
<a name="l00195"></a>00195     0x2711fd60UL, 0x438050e3UL, 0x069908a8UL, 0x3d7fedc4UL, 
<a name="l00196"></a>00196     0x826d2befUL, 0x4eeb8476UL, 0x488dcf25UL, 0x36c9d566UL,
<a name="l00197"></a>00197     0x28e74e41UL, 0xc2610acaUL, 0x3d49a9cfUL, 0xbae3b9dfUL, 
<a name="l00198"></a>00198     0xb65f8de6UL, 0x92aeaf64UL, 0x3ac7d5e6UL, 0x9ea80509UL,
<a name="l00199"></a>00199     0xf22b017dUL, 0xa4173f70UL, 0xdd1e16c3UL, 0x15e0d7f9UL, 
<a name="l00200"></a>00200     0x50b1b887UL, 0x2b9f4fd5UL, 0x625aba82UL, 0x6a017962UL,
<a name="l00201"></a>00201     0x2ec01b9cUL, 0x15488aa9UL, 0xd716e740UL, 0x40055a2cUL, 
<a name="l00202"></a>00202     0x93d29a22UL, 0xe32dbf9aUL, 0x058745b9UL, 0x3453dc1eUL,
<a name="l00203"></a>00203     0xd699296eUL, 0x496cff6fUL, 0x1c9f4986UL, 0xdfe2ed07UL, 
<a name="l00204"></a>00204     0xb87242d1UL, 0x19de7eaeUL, 0x053e561aUL, 0x15ad6f8cUL,
<a name="l00205"></a>00205     0x66626c1cUL, 0x7154c24cUL, 0xea082b2aUL, 0x93eb2939UL, 
<a name="l00206"></a>00206     0x17dcb0f0UL, 0x58d4f2aeUL, 0x9ea294fbUL, 0x52cf564cUL,
<a name="l00207"></a>00207     0x9883fe66UL, 0x2ec40581UL, 0x763953c3UL, 0x01d6692eUL, 
<a name="l00208"></a>00208     0xd3a0c108UL, 0xa1e7160eUL, 0xe4f2dfa6UL, 0x693ed285UL,
<a name="l00209"></a>00209     0x74904698UL, 0x4c2b0eddUL, 0x4f757656UL, 0x5d393378UL, 
<a name="l00210"></a>00210     0xa132234fUL, 0x3d321c5dUL, 0xc3f5e194UL, 0x4b269301UL,
<a name="l00211"></a>00211     0xc79f022fUL, 0x3c997e7eUL, 0x5e4f9504UL, 0x3ffafbbdUL, 
<a name="l00212"></a>00212     0x76f7ad0eUL, 0x296693f4UL, 0x3d1fce6fUL, 0xc61e45beUL,
<a name="l00213"></a>00213     0xd3b5ab34UL, 0xf72bf9b7UL, 0x1b0434c0UL, 0x4e72b567UL, 
<a name="l00214"></a>00214     0x5592a33dUL, 0xb5229301UL, 0xcfd2a87fUL, 0x60aeb767UL,
<a name="l00215"></a>00215     0x1814386bUL, 0x30bcc33dUL, 0x38a0c07dUL, 0xfd1606f2UL, 
<a name="l00216"></a>00216     0xc363519bUL, 0x589dd390UL, 0x5479f8e6UL, 0x1cb8d647UL,
<a name="l00217"></a>00217     0x97fd61a9UL, 0xea7759f4UL, 0x2d57539dUL, 0x569a58cfUL, 
<a name="l00218"></a>00218     0xe84e63adUL, 0x462e1b78UL, 0x6580f87eUL, 0xf3817914UL,
<a name="l00219"></a>00219     0x91da55f4UL, 0x40a230f3UL, 0xd1988f35UL, 0xb6e318d2UL, 
<a name="l00220"></a>00220     0x3ffa50bcUL, 0x3d40f021UL, 0xc3c0bdaeUL, 0x4958c24cUL,
<a name="l00221"></a>00221     0x518f36b2UL, 0x84b1d370UL, 0x0fedce83UL, 0x878ddadaUL, 
<a name="l00222"></a>00222     0xf2a279c7UL, 0x94e01be8UL, 0x90716f4bUL, 0x954b8aa3UL
<a name="l00223"></a>00223 };
<a name="l00224"></a>00224 
<a name="l00225"></a>00225 <span class="keyword">static</span> <span class="keyword">const</span> uint32_t S8[256] = {
<a name="l00226"></a>00226     0xe216300dUL, 0xbbddfffcUL, 0xa7ebdabdUL, 0x35648095UL, 
<a name="l00227"></a>00227     0x7789f8b7UL, 0xe6c1121bUL, 0x0e241600UL, 0x052ce8b5UL,
<a name="l00228"></a>00228     0x11a9cfb0UL, 0xe5952f11UL, 0xece7990aUL, 0x9386d174UL, 
<a name="l00229"></a>00229     0x2a42931cUL, 0x76e38111UL, 0xb12def3aUL, 0x37ddddfcUL,
<a name="l00230"></a>00230     0xde9adeb1UL, 0x0a0cc32cUL, 0xbe197029UL, 0x84a00940UL, 
<a name="l00231"></a>00231     0xbb243a0fUL, 0xb4d137cfUL, 0xb44e79f0UL, 0x049eedfdUL,
<a name="l00232"></a>00232     0x0b15a15dUL, 0x480d3168UL, 0x8bbbde5aUL, 0x669ded42UL, 
<a name="l00233"></a>00233     0xc7ece831UL, 0x3f8f95e7UL, 0x72df191bUL, 0x7580330dUL,
<a name="l00234"></a>00234     0x94074251UL, 0x5c7dcdfaUL, 0xabbe6d63UL, 0xaa402164UL, 
<a name="l00235"></a>00235     0xb301d40aUL, 0x02e7d1caUL, 0x53571daeUL, 0x7a3182a2UL,
<a name="l00236"></a>00236     0x12a8ddecUL, 0xfdaa335dUL, 0x176f43e8UL, 0x71fb46d4UL, 
<a name="l00237"></a>00237     0x38129022UL, 0xce949ad4UL, 0xb84769adUL, 0x965bd862UL,
<a name="l00238"></a>00238     0x82f3d055UL, 0x66fb9767UL, 0x15b80b4eUL, 0x1d5b47a0UL, 
<a name="l00239"></a>00239     0x4cfde06fUL, 0xc28ec4b8UL, 0x57e8726eUL, 0x647a78fcUL,
<a name="l00240"></a>00240     0x99865d44UL, 0x608bd593UL, 0x6c200e03UL, 0x39dc5ff6UL, 
<a name="l00241"></a>00241     0x5d0b00a3UL, 0xae63aff2UL, 0x7e8bd632UL, 0x70108c0cUL,
<a name="l00242"></a>00242     0xbbd35049UL, 0x2998df04UL, 0x980cf42aUL, 0x9b6df491UL, 
<a name="l00243"></a>00243     0x9e7edd53UL, 0x06918548UL, 0x58cb7e07UL, 0x3b74ef2eUL,
<a name="l00244"></a>00244     0x522fffb1UL, 0xd24708ccUL, 0x1c7e27cdUL, 0xa4eb215bUL, 
<a name="l00245"></a>00245     0x3cf1d2e2UL, 0x19b47a38UL, 0x424f7618UL, 0x35856039UL,
<a name="l00246"></a>00246     0x9d17dee7UL, 0x27eb35e6UL, 0xc9aff67bUL, 0x36baf5b8UL, 
<a name="l00247"></a>00247     0x09c467cdUL, 0xc18910b1UL, 0xe11dbf7bUL, 0x06cd1af8UL,
<a name="l00248"></a>00248     0x7170c608UL, 0x2d5e3354UL, 0xd4de495aUL, 0x64c6d006UL, 
<a name="l00249"></a>00249     0xbcc0c62cUL, 0x3dd00db3UL, 0x708f8f34UL, 0x77d51b42UL,
<a name="l00250"></a>00250     0x264f620fUL, 0x24b8d2bfUL, 0x15c1b79eUL, 0x46a52564UL, 
<a name="l00251"></a>00251     0xf8d7e54eUL, 0x3e378160UL, 0x7895cda5UL, 0x859c15a5UL,
<a name="l00252"></a>00252     0xe6459788UL, 0xc37bc75fUL, 0xdb07ba0cUL, 0x0676a3abUL, 
<a name="l00253"></a>00253     0x7f229b1eUL, 0x31842e7bUL, 0x24259fd7UL, 0xf8bef472UL,
<a name="l00254"></a>00254     0x835ffcb8UL, 0x6df4c1f2UL, 0x96f5b195UL, 0xfd0af0fcUL, 
<a name="l00255"></a>00255     0xb0fe134cUL, 0xe2506d3dUL, 0x4f9b12eaUL, 0xf215f225UL,
<a name="l00256"></a>00256     0xa223736fUL, 0x9fb4c428UL, 0x25d04979UL, 0x34c713f8UL, 
<a name="l00257"></a>00257     0xc4618187UL, 0xea7a6e98UL, 0x7cd16efcUL, 0x1436876cUL,
<a name="l00258"></a>00258     0xf1544107UL, 0xbedeee14UL, 0x56e9af27UL, 0xa04aa441UL, 
<a name="l00259"></a>00259     0x3cf7c899UL, 0x92ecbae6UL, 0xdd67016dUL, 0x151682ebUL,
<a name="l00260"></a>00260     0xa842eedfUL, 0xfdba60b4UL, 0xf1907b75UL, 0x20e3030fUL, 
<a name="l00261"></a>00261     0x24d8c29eUL, 0xe139673bUL, 0xefa63fb8UL, 0x71873054UL,
<a name="l00262"></a>00262     0xb6f2cf3bUL, 0x9f326442UL, 0xcb15a4ccUL, 0xb01a4504UL, 
<a name="l00263"></a>00263     0xf1e47d8dUL, 0x844a1be5UL, 0xbae7dfdcUL, 0x42cbda70UL,
<a name="l00264"></a>00264     0xcd7dae0aUL, 0x57e85b7aUL, 0xd53f5af6UL, 0x20cf4d8cUL, 
<a name="l00265"></a>00265     0xcea4d428UL, 0x79d130a4UL, 0x3486ebfbUL, 0x33d3cddcUL,
<a name="l00266"></a>00266     0x77853b53UL, 0x37effcb5UL, 0xc5068778UL, 0xe580b3e6UL, 
<a name="l00267"></a>00267     0x4e68b8f4UL, 0xc5c8b37eUL, 0x0d809ea2UL, 0x398feb7cUL,
<a name="l00268"></a>00268     0x132a4f94UL, 0x43b7950eUL, 0x2fee7d1cUL, 0x223613bdUL, 
<a name="l00269"></a>00269     0xdd06caa2UL, 0x37df932bUL, 0xc4248289UL, 0xacf3ebc3UL,
<a name="l00270"></a>00270     0x5715f6b7UL, 0xef3478ddUL, 0xf267616fUL, 0xc148cbe4UL, 
<a name="l00271"></a>00271     0x9052815eUL, 0x5e410fabUL, 0xb48a2465UL, 0x2eda7fa4UL,
<a name="l00272"></a>00272     0xe87b40e4UL, 0xe98ea084UL, 0x5889e9e1UL, 0xefd390fcUL, 
<a name="l00273"></a>00273     0xdd07d35bUL, 0xdb485694UL, 0x38d7e5b2UL, 0x57720101UL,
<a name="l00274"></a>00274     0x730edebcUL, 0x5b643113UL, 0x94917e4fUL, 0x503c2fbaUL, 
<a name="l00275"></a>00275     0x646f1282UL, 0x7523d24aUL, 0xe0779695UL, 0xf9c17a8fUL,
<a name="l00276"></a>00276     0x7a5b2121UL, 0xd187b896UL, 0x29263a4dUL, 0xba510cdfUL, 
<a name="l00277"></a>00277     0x81f47c9fUL, 0xad1163edUL, 0xea7b5965UL, 0x1a00726eUL,
<a name="l00278"></a>00278     0x11403092UL, 0x00da6d77UL, 0x4a0cdd61UL, 0xad1f4603UL, 
<a name="l00279"></a>00279     0x605bdfb0UL, 0x9eedc364UL, 0x22ebe6a8UL, 0xcee7d28aUL,
<a name="l00280"></a>00280     0xa0e736a0UL, 0x5564a6b9UL, 0x10853209UL, 0xc7eb8f37UL, 
<a name="l00281"></a>00281     0x2de705caUL, 0x8951570fUL, 0xdf09822bUL, 0xbd691a6cUL,
<a name="l00282"></a>00282     0xaa12e4f2UL, 0x87451c0fUL, 0xe0f6a27aUL, 0x3ada4819UL, 
<a name="l00283"></a>00283     0x4cf1764fUL, 0x0d771c2bUL, 0x67cdb156UL, 0x350d8384UL,
<a name="l00284"></a>00284     0x5938fa0fUL, 0x42399ef3UL, 0x36997b07UL, 0x0e84093dUL, 
<a name="l00285"></a>00285     0x4aa93e61UL, 0x8360d87bUL, 0x1fa98b0cUL, 0x1149382cUL,
<a name="l00286"></a>00286     0xe97625a5UL, 0x0614d1b7UL, 0x0e25244bUL, 0x0c768347UL, 
<a name="l00287"></a>00287     0x589e8d82UL, 0x0d2059d1UL, 0xa466bb1eUL, 0xf8da0a82UL,
<a name="l00288"></a>00288     0x04f19130UL, 0xba6e4ec0UL, 0x99265164UL, 0x1ee7230dUL, 
<a name="l00289"></a>00289     0x50b2ad80UL, 0xeaee6801UL, 0x8db2a283UL, 0xea8bf59eUL
<a name="l00290"></a>00290 };
<a name="l00291"></a>00291 
<a name="l00292"></a>00292 <span class="keyword">extern</span> <span class="keyword">const</span> uint32_t __cast_s1[256];
<a name="l00293"></a>00293 <span class="keyword">extern</span> <span class="keyword">const</span> uint32_t __cast_s2[256];
<a name="l00294"></a>00294 <span class="keyword">extern</span> <span class="keyword">const</span> uint32_t __cast_s3[256];
<a name="l00295"></a>00295 <span class="keyword">extern</span> <span class="keyword">const</span> uint32_t __cast_s4[256];
<a name="l00296"></a>00296 
<a name="l00297"></a>00297 <span class="preprocessor">#define S1 __cast_s1</span>
<a name="l00298"></a>00298 <span class="preprocessor"></span><span class="preprocessor">#define S2 __cast_s2</span>
<a name="l00299"></a>00299 <span class="preprocessor"></span><span class="preprocessor">#define S3 __cast_s3</span>
<a name="l00300"></a>00300 <span class="preprocessor"></span><span class="preprocessor">#define S4 __cast_s4</span>
<a name="l00301"></a>00301 <span class="preprocessor"></span>
<a name="l00302"></a>00302 <span class="preprocessor">#define FN(i, r) ((i) = __rol32((i), (r)), \</span>
<a name="l00303"></a>00303 <span class="preprocessor">    ((S1[(i) &gt;&gt; 24] ^ S2[((i) &gt;&gt; 16) &amp; 0xFF]) - \</span>
<a name="l00304"></a>00304 <span class="preprocessor">    S3[((i) &gt;&gt; 8) &amp; 0xFF] + S4[(i) &amp; 0xFF]))</span>
<a name="l00305"></a>00305 <span class="preprocessor"></span>
<a name="l00306"></a>00306 <span class="preprocessor">#define F1(i, d, m, r) ((i) = ((m) + (d)), FN(i, r))</span>
<a name="l00307"></a>00307 <span class="preprocessor"></span><span class="preprocessor">#define F2(i, d, m, r) ((i) = ((m) ^ (d)), FN(i, r))</span>
<a name="l00308"></a>00308 <span class="preprocessor"></span><span class="preprocessor">#define F3(i, d, m, r) ((i) = ((m) - (d)), FN(i, r))</span>
<a name="l00309"></a>00309 <span class="preprocessor"></span>
<a name="l00310"></a>00310 <span class="preprocessor">#define ROUND1(i, l, r, t, c) \</span>
<a name="l00311"></a>00311 <span class="preprocessor">    (t) = (l); (l) = (r); (r) = (t) ^ F1(i, r, km[c], kr[c])</span>
<a name="l00312"></a>00312 <span class="preprocessor"></span><span class="preprocessor">#define ROUND2(i, l, r, t, c) \</span>
<a name="l00313"></a>00313 <span class="preprocessor">    (t) = (l); (l) = (r); (r) = (t) ^ F2(i, r, km[c], kr[c])</span>
<a name="l00314"></a>00314 <span class="preprocessor"></span><span class="preprocessor">#define ROUND3(i, l, r, t, c) \</span>
<a name="l00315"></a>00315 <span class="preprocessor">    (t) = (l); (l) = (r); (r) = (t) ^ F3(i, r, km[c], kr[c])</span>
<a name="l00316"></a>00316 <span class="preprocessor"></span>
<a name="l00317"></a>00317 <span class="preprocessor">#define XI(i) ((x[(i) &gt;&gt; 2] &gt;&gt; ((3 - ((i) &amp; 3)) &lt;&lt; 3)) &amp; 0xFF)</span>
<a name="l00318"></a>00318 <span class="preprocessor"></span><span class="preprocessor">#define ZI(i) ((z[(i) &gt;&gt; 2] &gt;&gt; ((3 - ((i) &amp; 3)) &lt;&lt; 3)) &amp; 0xFF)</span>
<a name="l00319"></a>00319 <span class="preprocessor"></span>
<a name="l00320"></a>00320 <span class="keyword">static</span> <span class="keywordtype">void</span> __cast5_key_schedule(uint32_t* x, uint32_t* z, uint32_t* k)
<a name="l00321"></a>00321 {
<a name="l00322"></a>00322     z[0] = x[0] ^ S5[XI(13)] ^ S6[XI(15)] ^ S7[XI(12)] ^ S8[XI(14)] ^ S7[XI( 8)];
<a name="l00323"></a>00323     z[1] = x[2] ^ S5[ZI( 0)] ^ S6[ZI( 2)] ^ S7[ZI( 1)] ^ S8[ZI( 3)] ^ S8[XI(10)];
<a name="l00324"></a>00324     z[2] = x[3] ^ S5[ZI( 7)] ^ S6[ZI( 6)] ^ S7[ZI( 5)] ^ S8[ZI( 4)] ^ S5[XI( 9)];
<a name="l00325"></a>00325     z[3] = x[1] ^ S5[ZI(10)] ^ S6[ZI( 9)] ^ S7[ZI(11)] ^ S8[ZI( 8)] ^ S6[XI(11)];
<a name="l00326"></a>00326 
<a name="l00327"></a>00327     k[0] = S5[ZI( 8)] ^ S6[ZI( 9)] ^ S7[ZI(7)] ^ S8[ZI(6)] ^ S5[ZI( 2)];
<a name="l00328"></a>00328     k[1] = S5[ZI(10)] ^ S6[ZI(11)] ^ S7[ZI(5)] ^ S8[ZI(4)] ^ S6[ZI( 6)];
<a name="l00329"></a>00329     k[2] = S5[ZI(12)] ^ S6[ZI(13)] ^ S7[ZI(3)] ^ S8[ZI(2)] ^ S7[ZI( 9)];
<a name="l00330"></a>00330     k[3] = S5[ZI(14)] ^ S6[ZI(15)] ^ S7[ZI(1)] ^ S8[ZI(0)] ^ S8[ZI(12)];
<a name="l00331"></a>00331 
<a name="l00332"></a>00332     x[0] = z[2] ^ S5[ZI( 5)] ^ S6[ZI(7)] ^ S7[ZI( 4)] ^ S8[ZI(6)] ^ S7[ZI( 8)];
<a name="l00333"></a>00333     x[1] = z[0] ^ S5[XI( 0)] ^ S6[XI(2)] ^ S7[XI( 1)] ^ S8[XI(3)] ^ S8[XI(10)];
<a name="l00334"></a>00334     x[2] = z[1] ^ S5[XI( 7)] ^ S6[XI(6)] ^ S7[XI( 5)] ^ S8[XI(4)] ^ S5[XI( 9)];
<a name="l00335"></a>00335     x[3] = z[3] ^ S5[XI(10)] ^ S6[XI(9)] ^ S7[XI(11)] ^ S8[XI(8)] ^ S6[XI(11)];
<a name="l00336"></a>00336 
<a name="l00337"></a>00337     k[4] = S5[XI(3)] ^ S6[XI(2)] ^ S7[XI(12)] ^ S8[XI(13)] ^ S5[XI( 8)];
<a name="l00338"></a>00338     k[5] = S5[XI(1)] ^ S6[XI(0)] ^ S7[XI(14)] ^ S8[XI(15)] ^ S6[XI(13)];
<a name="l00339"></a>00339     k[6] = S5[XI(7)] ^ S6[XI(6)] ^ S7[XI( 8)] ^ S8[XI( 9)] ^ S7[XI( 3)];
<a name="l00340"></a>00340     k[7] = S5[XI(5)] ^ S6[XI(4)] ^ S7[XI(10)] ^ S8[XI(11)] ^ S8[XI( 7)];
<a name="l00341"></a>00341 
<a name="l00342"></a>00342     z[0] = x[0] ^ S5[XI(13)] ^ S6[XI(15)] ^ S7[XI(12)] ^ S8[XI(14)] ^ S7[XI( 8)];
<a name="l00343"></a>00343     z[1] = x[2] ^ S5[ZI( 0)] ^ S6[ZI( 2)] ^ S7[ZI( 1)] ^ S8[ZI( 3)] ^ S8[XI(10)];
<a name="l00344"></a>00344     z[2] = x[3] ^ S5[ZI( 7)] ^ S6[ZI( 6)] ^ S7[ZI( 5)] ^ S8[ZI( 4)] ^ S5[XI( 9)];
<a name="l00345"></a>00345     z[3] = x[1] ^ S5[ZI(10)] ^ S6[ZI( 9)] ^ S7[ZI(11)] ^ S8[ZI( 8)] ^ S6[XI(11)];
<a name="l00346"></a>00346 
<a name="l00347"></a>00347     k[ 8] = S5[ZI(3)] ^ S6[ZI(2)] ^ S7[ZI(12)] ^ S8[ZI(13)] ^ S5[ZI( 9)];
<a name="l00348"></a>00348     k[ 9] = S5[ZI(1)] ^ S6[ZI(0)] ^ S7[ZI(14)] ^ S8[ZI(15)] ^ S6[ZI(12)];
<a name="l00349"></a>00349     k[10] = S5[ZI(7)] ^ S6[ZI(6)] ^ S7[ZI( 8)] ^ S8[ZI( 9)] ^ S7[ZI( 2)];
<a name="l00350"></a>00350     k[11] = S5[ZI(5)] ^ S6[ZI(4)] ^ S7[ZI(10)] ^ S8[ZI(11)] ^ S8[ZI( 6)];
<a name="l00351"></a>00351 
<a name="l00352"></a>00352     x[0] = z[2] ^ S5[ZI( 5)] ^ S6[ZI(7)] ^ S7[ZI( 4)] ^ S8[ZI(6)] ^ S7[ZI(0)];
<a name="l00353"></a>00353     x[1] = z[0] ^ S5[XI( 0)] ^ S6[XI(2)] ^ S7[XI( 1)] ^ S8[XI(3)] ^ S8[XI(2)];
<a name="l00354"></a>00354     x[2] = z[1] ^ S5[XI( 7)] ^ S6[XI(6)] ^ S7[XI( 5)] ^ S8[XI(4)] ^ S5[XI(1)];
<a name="l00355"></a>00355     x[3] = z[3] ^ S5[XI(10)] ^ S6[XI(9)] ^ S7[XI(11)] ^ S8[XI(8)] ^ S6[XI(3)];
<a name="l00356"></a>00356 
<a name="l00357"></a>00357     k[12] = S5[XI( 8)] ^ S6[XI( 9)] ^ S7[XI(7)] ^ S8[XI(6)] ^ S5[XI( 3)];
<a name="l00358"></a>00358     k[13] = S5[XI(10)] ^ S6[XI(11)] ^ S7[XI(5)] ^ S8[XI(4)] ^ S6[XI( 7)];
<a name="l00359"></a>00359     k[14] = S5[XI(12)] ^ S6[XI(13)] ^ S7[XI(3)] ^ S8[XI(2)] ^ S7[XI( 8)];
<a name="l00360"></a>00360     k[15] = S5[XI(14)] ^ S6[XI(15)] ^ S7[XI(1)] ^ S8[XI(0)] ^ S8[XI(13)];
<a name="l00361"></a>00361 }
<a name="l00362"></a>00362 
<a name="l00363"></a>00363 NV_IMPL <span class="keywordtype">void</span> __cast5_set_key(<a class="code" href="structcast5__key.html" title="Cast5密钥">cast5_key</a>* key, uint32_t* km, <a class="code" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2" title="8比特无符号整型">uint8_t</a>* kr, 
<a name="l00364"></a>00364                                 <a class="code" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2" title="8比特无符号整型">uint8_t</a>* src_key, <span class="keywordtype">size_t</span> cnt)
<a name="l00365"></a>00365 {
<a name="l00366"></a>00366     uint32_t x[4];
<a name="l00367"></a>00367     uint32_t z[4];
<a name="l00368"></a>00368     uint32_t k[16];
<a name="l00369"></a>00369     uint32_t _k[4] = {0, 0, 0, 0};
<a name="l00370"></a>00370     <span class="keywordtype">int</span> i;
<a name="l00371"></a>00371     
<a name="l00372"></a>00372     key-&gt;rd = (cnt &lt;= 10);
<a name="l00373"></a>00373 
<a name="l00374"></a>00374     memcpy(_k, src_key, cnt);
<a name="l00375"></a>00375 
<a name="l00376"></a>00376     x[0] = __be32_to_cpu(_k[0]);
<a name="l00377"></a>00377     x[1] = __be32_to_cpu(_k[1]);
<a name="l00378"></a>00378     x[2] = __be32_to_cpu(_k[2]);
<a name="l00379"></a>00379     x[3] = __be32_to_cpu(_k[3]);
<a name="l00380"></a>00380 
<a name="l00381"></a>00381     __cast5_key_schedule(x, z, k);
<a name="l00382"></a>00382     <span class="keywordflow">for</span> (i = 0; i &lt; 16; ++i)
<a name="l00383"></a>00383         km[i] = k[i];
<a name="l00384"></a>00384     
<a name="l00385"></a>00385     __cast5_key_schedule(x, z, k);
<a name="l00386"></a>00386     <span class="keywordflow">for</span> (i = 0; i &lt; 16; ++i)
<a name="l00387"></a>00387         kr[i] = k[i] &amp; 0x1F;
<a name="l00388"></a>00388 }
<a name="l00389"></a>00389 
<a name="l00390"></a>00390 NV_IMPL <span class="keywordtype">void</span> __cast5_encrypt(uint32_t* km, <a class="code" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2" title="8比特无符号整型">uint8_t</a>* kr, <span class="keywordtype">int</span> rd, 
<a name="l00391"></a>00391                             uint32_t* dst, uint32_t* src)
<a name="l00392"></a>00392 {
<a name="l00393"></a>00393     uint32_t i, t;
<a name="l00394"></a>00394     uint32_t l = __be32_to_cpu(src[0]);
<a name="l00395"></a>00395     uint32_t r = __be32_to_cpu(src[1]);
<a name="l00396"></a>00396 
<a name="l00397"></a>00397     ROUND1(i, l, r, t,  0);
<a name="l00398"></a>00398     ROUND2(i, l, r, t,  1);
<a name="l00399"></a>00399     ROUND3(i, l, r, t,  2);
<a name="l00400"></a>00400     ROUND1(i, l, r, t,  3);
<a name="l00401"></a>00401     ROUND2(i, l, r, t,  4);
<a name="l00402"></a>00402     ROUND3(i, l, r, t,  5);
<a name="l00403"></a>00403     ROUND1(i, l, r, t,  6);
<a name="l00404"></a>00404     ROUND2(i, l, r, t,  7);
<a name="l00405"></a>00405     ROUND3(i, l, r, t,  8);
<a name="l00406"></a>00406     ROUND1(i, l, r, t,  9);
<a name="l00407"></a>00407     ROUND2(i, l, r, t, 10);
<a name="l00408"></a>00408     ROUND3(i, l, r, t, 11);
<a name="l00409"></a>00409 
<a name="l00410"></a>00410     <span class="keywordflow">if</span> (!rd) {
<a name="l00411"></a>00411         ROUND1(i, l, r, t, 12);
<a name="l00412"></a>00412         ROUND2(i, l, r, t, 13);
<a name="l00413"></a>00413         ROUND3(i, l, r, t, 14);
<a name="l00414"></a>00414         ROUND1(i, l, r, t, 15);
<a name="l00415"></a>00415     }
<a name="l00416"></a>00416 
<a name="l00417"></a>00417     dst[0] = __cpu_to_be32(r);
<a name="l00418"></a>00418     dst[1] = __cpu_to_be32(l);
<a name="l00419"></a>00419 }
<a name="l00420"></a>00420 
<a name="l00421"></a>00421 NV_IMPL <span class="keywordtype">void</span> __cast5_decrypt(uint32_t* km, <a class="code" href="group___xE6_x95_xB4_xE5_x9E_x8B_xE5_xAE_x9A_xE4_xB9_x89.html#gae1affc9ca37cfb624959c866a73f83c2" title="8比特无符号整型">uint8_t</a>* kr, <span class="keywordtype">int</span> rd, 
<a name="l00422"></a>00422                             uint32_t* dst, uint32_t* src)
<a name="l00423"></a>00423 {
<a name="l00424"></a>00424     uint32_t i, t;
<a name="l00425"></a>00425     uint32_t l = __be32_to_cpu(src[0]);
<a name="l00426"></a>00426     uint32_t r = __be32_to_cpu(src[1]);
<a name="l00427"></a>00427 
<a name="l00428"></a>00428     <span class="keywordflow">if</span> (!rd) {
<a name="l00429"></a>00429         ROUND1(i, l, r, t, 15);
<a name="l00430"></a>00430         ROUND3(i, l, r, t, 14);
<a name="l00431"></a>00431         ROUND2(i, l, r, t, 13);
<a name="l00432"></a>00432         ROUND1(i, l, r, t, 12);
<a name="l00433"></a>00433     }
<a name="l00434"></a>00434 
<a name="l00435"></a>00435     ROUND3(i, l, r, t, 11);
<a name="l00436"></a>00436     ROUND2(i, l, r, t, 10);
<a name="l00437"></a>00437     ROUND1(i, l, r, t,  9);
<a name="l00438"></a>00438     ROUND3(i, l, r, t,  8);
<a name="l00439"></a>00439     ROUND2(i, l, r, t,  7);
<a name="l00440"></a>00440     ROUND1(i, l, r, t,  6);
<a name="l00441"></a>00441     ROUND3(i, l, r, t,  5);
<a name="l00442"></a>00442     ROUND2(i, l, r, t,  4);
<a name="l00443"></a>00443     ROUND1(i, l, r, t,  3);
<a name="l00444"></a>00444     ROUND3(i, l, r, t,  2);
<a name="l00445"></a>00445     ROUND2(i, l, r, t,  1);
<a name="l00446"></a>00446     ROUND1(i, l, r, t,  0);
<a name="l00447"></a>00447 
<a name="l00448"></a>00448     dst[0] = __cpu_to_be32(r);
<a name="l00449"></a>00449     dst[1] = __cpu_to_be32(l);
<a name="l00450"></a>00450 }
<a name="l00451"></a>00451 
<a name="l00452"></a>00452 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00453"></a>00453 <span class="preprocessor"></span>}
<a name="l00454"></a>00454 <span class="preprocessor">#endif </span><span class="comment">/* #ifdef __cplusplus */</span>
<a name="l00455"></a>00455 
</pre></div></div>
</div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>数据结构</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>文件</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>变量</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>类型定义</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>宏定义</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated at 2015年七月16日 星期四 12:00:37 for Navo Portable Library by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </small></address>
</body>
</html>
